<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');


Route::get('/permission/store', 'PermissionController@index');
Route::get('/permission/destroy/{id}', 'PermissionController@destroy');

Route::get('/role/store', 'RoleController@store');
Route::get('/role/attachPermission/{id}', 'RoleController@attachPermission');

Route::get('/user/index', 'UserController@index');
Route::get('/user/role', 'UserController@checkRole');
Route::get('/user/permission', 'UserController@checkPermission');


Route::get('/check', [
    'uses' => 'RbacController@index',
    'middleware' => 'rbac:role,admin'
]);


